package com.goods.shop.util;

import cn.hutool.core.io.FileUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONObject;
import com.goods.shop.model.wx.WxEventUrlType;
import com.goods.shop.service.constants.WeiXinUrlFinals;
import com.goods.shop.service.model.WeiXinMenu;
import com.goods.shop.service.model.WeiXinParam;
import com.goods.shop.service.model.wxmessage.QrCodeModel;
import com.goods.shop.service.model.wxmessage.WxMsgType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.util.FileCopyUtils;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.*;

public class WeiXinUtils {
    public static Logger logger = LogManager.getLogger(LogManager.ROOT_LOGGER_NAME);
    //获取access_token
    public static String getAccessToken(String appid,String secret) {
        String accessToken = "";
        String grant_type = "client_credential";//获取access_token填写client_credential
        String url= WeiXinUrlFinals.ACCESSTOKENURL.replaceAll("\\{"+WeiXinUrlFinals.APPID+"\\}",appid).replaceAll("\\{"+WeiXinUrlFinals.APPSECRET+"\\}",secret);
//        String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=" + grant_type + "&appid=" + appid + "&secret=" + secret;
        //这个url链接地址和参数皆不能变
        logger.info("url="+url);
        try {
            //获取code后，请求以下链接获取access_token
            String result= HttpRequest.get(url).header("Content-Type","application/x-www-form-urlencoded").execute().body().toString();
            logger.info("AccessToken.result={}",result);
            JSONObject resultJSON =  JSONObject.parseObject(result);
            accessToken = resultJSON.getString("access_token");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return accessToken;
    }
    //获取ticket
    public static String getTicket(String accessToken) {
        String ticket = null;
        String url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token="+ accessToken +"&type=jsapi";//这个url链接和参数不能变
        try {
            String result= HttpRequest.get(url).header("Content-Type","application/x-www-form-urlencoded")
                    .execute().body().toString();

            JSONObject demoJson = JSONObject.parseObject(result);
            System.out.println("JSON字符串："+demoJson);
            ticket = demoJson.getString("ticket");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return ticket;
    }
    //获取signnature值
    public static String getSignNature(String appid,String secret) {
        //获取Token
        String token = getAccessToken(appid, secret);
        //2、获取Ticket
        String ticket = getTicket(token);
        String noncestr = UUID.randomUUID().toString().replace("-", "").substring(0, 16);
        String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
        String url = "http://www.ru-tourism.com/weixin.do";//TODO
        //5、将参数排序并拼接字符串
        String str = "jsapi_ticket=" + ticket + "&noncestr=" + noncestr + "&timestamp=" + timestamp + "&url=" + url;

        //6、将字符串进行sha1加密
        String signature = EncUtils.SHA1(str);
        System.out.println("参数：" + str + "\n签名：" + signature);
        return signature;
    }
    //获取signnature值
    public static String generateSignature(String appid, String secret, WeiXinParam params) {
        //获取Token
        String token = "GOODS";
//        String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
//        String nonce = UUID.randomUUID().toString().replace("-", "").substring(0, 16);
        String timestamp=params.getTimestamp();
        String nonce=params.getNonce();
        String[] arrTemps = {token,timestamp,nonce};
        Arrays.sort(arrTemps);
        StringBuffer results = new StringBuffer();
        for(int i=0;i<arrTemps.length;i++){
            results.append(arrTemps[i]);
        }
        String signature= EncUtils.SHA1(results.toString());
        return signature;
    }
    //获取微信callback IP地址
    public static String getCallBackIp(String accessToken){
        String url= WeiXinUrlFinals.GETCALLBACKIPURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken);
        String result="";
        try {
            //获取微信callback IP地址
            result= HttpRequest.get(url).execute().body().toString();
//            logger.info("getCallBackIp.result={}",result);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    //获取微信API接口 IP地址
    public static String getAPIDomainIp(String accessToken){
        String url= WeiXinUrlFinals.GETAPIDOMAINIP.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken);
        String result="";
        try {
            //获取微信callback IP地址
            result= HttpRequest.get(url).execute().body().toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    //网络监测
    public static String checkNet(String accessToken){
        String url= WeiXinUrlFinals.CHECKNETURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken);
        String result="";
        Map<String,String> params=new HashMap<>();
        params.put("action","all");
        params.put("check_operator","DEFAULT");
        String paramsJson=JSONObject.toJSONString(params);
        try {
            //获取微信callback IP地址
            result= HttpRequest.post(url).body(paramsJson,"application/json").execute().body().toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    //创建菜单
    public static String createMenu(String accessToken){
        String url= WeiXinUrlFinals.CREATEMENUURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken);
        String result="";
        List<WeiXinMenu> menus=new ArrayList<>();
        WeiXinMenu firstMenu=new WeiXinMenu();
        firstMenu.setName("自娱自乐");
        firstMenu.setType("click");
        firstMenu.setKey("PLAY_001");
        menus.add(firstMenu);
        WeiXinMenu secondMenu=new WeiXinMenu();
        secondMenu.setName("音乐");
        secondMenu.setType("view");
        secondMenu.setUrl("http://music.baidu.com");
        menus.add(secondMenu);
        WeiXinMenu thirdMenu=new WeiXinMenu();
        thirdMenu.setName("关于我2");
        thirdMenu.setType("view");
        thirdMenu.setUrl("http://www.ru-tourism.com/");
        menus.add(thirdMenu);
        Map<String,List<WeiXinMenu>> menusMap=new HashMap<>();
        menusMap.put("button",menus);
        String paramsJson=JSONObject.toJSONString(menusMap);
        logger.info("paramsJson=={}",paramsJson);
        try {
            //获取微信callback IP地址
            result= HttpRequest.post(url).body(paramsJson,"application/json").execute().body().toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    //获取菜单
    public static String getMenu(String accessToken){
        String url= WeiXinUrlFinals.GETMENUURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken);
        String result="";
        try {
            //获取微信callback IP地址
            result= HttpRequest.get(url).execute().body().toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    //获取菜单
    public static String getMenu2(String accessToken){
        String url= WeiXinUrlFinals.TAGGETURL;
        String result="";
        Map<String,Object> params=new HashMap<>();
        params.put("access_token",accessToken);

        result= HttpUtils.requestGet(url,params);
        logger.info("getMenu2.result====={}",result);
        return result;
    }
    //上传临时素材 TODO
    public static String upload(String accessToken,String filePath){
        File file=new File(filePath);
        String fileName=file.getName().toUpperCase();

        WxMsgType type= WxMsgType.IMAGE;
        if(fileName.endsWith("MP3")){
            type=WxMsgType.VOICE;
        }else if(fileName.endsWith("MP4")){
            type=WxMsgType.VIDEO;
        }
        String url= WeiXinUrlFinals.UPLOADURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken).replaceAll("\\{"+WeiXinUrlFinals.TYPE+"\\}",type.getName());
        String result="";
        String name="media";
        try {
            result= WeiXinResourceUtils.fileMaterial(url,file,name);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    //获取临时素材
    public static String getTempResource(String accessToken,String meidaId){
        String url= WeiXinUrlFinals.GETTEMPRESOUREURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken)
                .replaceAll("\\{"+WeiXinUrlFinals.MEDIA_ID+"\\}",meidaId);
        String result="";
        try {
            result= HttpRequest.get(url).timeout(10000).execute().body().toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    //获取临时素材-列表
    public static String getResourceList(String accessToken){
        String url= WeiXinUrlFinals.GETRESOURCELISTURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken);
        String result="";
        Map<String,Object> params=new HashMap<>();
        params.put("type",WxMsgType.IMAGE.getName());
        params.put("offset",0);
        params.put("count",20);
        String paramsJson= JSONObject.toJSONString(params);
        try {
            result= HttpRequest.post(url).body(paramsJson,"application/json").execute().body().toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    //用户列表
    public static String userList(String accessToken,String nextOpenId){
        String url= WeiXinUrlFinals.USERLISTURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken).replaceAll("\\{"+WeiXinUrlFinals.NEXT_OPENID+"\\}",nextOpenId);
        String result="";
        try {
            result= HttpRequest.get(url).execute().body().toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }

    //二维码请求说明 TODO
    public static String createTicket(String accessToken, QrCodeModel qrCodeModel){
        String url= WeiXinUrlFinals.CREATETOKENURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken);
        String result="";
        Map<String,Object> scenceObject=new HashMap<>();
        scenceObject.put("scene_id",qrCodeModel.getSceneId());
        if(null!=qrCodeModel.getSceneStr()&&!qrCodeModel.getSceneStr().equals("")){
            scenceObject.put("scene_str",qrCodeModel.getSceneStr());
        }
        Map<String,Object> actionInfo=new HashMap<>();
        actionInfo.put("scene",scenceObject);
        Map<String,Object> bodyParams=new HashMap<>();
        bodyParams.put("expire_seconds",qrCodeModel.getExpireSeconds());
        bodyParams.put("action_name",qrCodeModel.getActionName());
        bodyParams.put("action_info",actionInfo);

        String paramsJson= JSONObject.toJSONString(bodyParams);
        try {
            result= HttpRequest.post(url).body(paramsJson,"application/json").execute().body().toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
//    public static HttpResponse showqrcode(String ticket){
//        try{
//            ticket= URLEncoder.encode(ticket,"UTF-8");
//        }catch(Exception e){
//            e.printStackTrace();
//        }
//        String url= WeiXinUrlFinals.SHOWQRCODEURL.replaceAll("\\{"+WeiXinUrlFinals.TICKET+"\\}",ticket);
//        String result="";
//        try {
//            HttpResponse response=HttpRequest.get(url).execute();
//
//            return response;
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        return null;
//    }

    /**
     * 请求二维码，返回生成Response数据流
     * @param ticket
     * @return
     */
    public static String showQrcode(String ticket){
//        Map<String,Object> urlParams=new HashMap<>();
        try {
            ticket= URLEncoder.encode(ticket,"UTF-8");
//            urlParams.put("ticket",ticket);
            HttpResponse response=HttpRequest.get(WeiXinUrlFinals.SHOWQRCODEURL+"?ticket="+ticket).execute();
            InputStream inputStream=response.bodyStream();
            int size=inputStream.available();
            System.out.println("size====="+size);
            byte[] bytes=new byte[size];
            inputStream.read(bytes);
            String result=new String(bytes);
            System.out.println("======="+result);
            return result;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    //客服消息管理
    //添加客服帐号
    public static String addKf(String accessToken){
        String url= WeiXinUrlFinals.ADDKFURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken);
        String result="";
        try {
            result= HttpRequest.post(url).execute().body().toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    //客户列表
    public static String kfList(String accessToken){
        String url= WeiXinUrlFinals.KFLISTURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken);
        String result="";
        try {
            result= HttpRequest.post(url).execute().body().toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }

    //群发接口
    //上传图片 TODO
    public static String uploadImage(String accessToken,String filePath){
        File file=new File(filePath);
        String fileName=file.getName().toUpperCase();
        String url= WeiXinUrlFinals.UPLOADIMGURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken);
        String result="";
        String name="buffer";
        try {
            result= WeiXinResourceUtils.fileMaterial(url,file,name);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    //群发消息
    public static String sendAll(String accessToken,String mediaId){
        String url= WeiXinUrlFinals.SENDALLURL.replaceAll("\\{"+WeiXinUrlFinals.ACCESSTOKEN+"\\}",accessToken);
        String result="";
        Map<String,Object> params=new HashMap<>();
        Map<String,Object> filter=new HashMap<>();
        Map<String,Object> images=new HashMap<>();
        filter.put("is_to_all",true);
        filter.put("tag_id",2);
        params.put("filter",filter);

        images.put("media_ids",new String[]{mediaId});
        images.put("recommend","文本内容");
        images.put("need_open_comment",1);
        images.put("only_fans_can_comment",0);
        params.put("images",images);

        params.put("msgtype","image");
        result= HttpUtils.requestPostBodyJSONParam(url,params);
        return result;
    }
    //打标签
    public static String createTag(String accessToken,String tagName){
        String url= WeiXinUrlFinals.CREATETAGURL;
        String result="";
        Map<String,Object> params=new HashMap<>();
        params.put("access_token",accessToken);
        Map<String,Object> formParam=new HashMap<>();
        formParam.put("name",tagName);
        Map<String,Object> formParams=new HashMap<>();
        formParams.put("tag",formParam);

        result= HttpUtils.requestPostUrlBodyJSONParam(url,params,formParams);
        logger.info("createTag.result====={}",result);
        return result;
    }
    //获取已经打的标签
    public static String tagGet(String accessToken){
        String url= WeiXinUrlFinals.TAGGETURL;
        String result="";
        Map<String,Object> params=new HashMap<>();
        params.put("access_token",accessToken);

        result= HttpUtils.requestGet(url,params);
        logger.info("tagGet.result====={}",result);
        return result;
    }
    //打标签--给用户设置不同的菜单
    public static String batchtagging(String accessToken,List<String> openIdList,int tagId){
        String url= WeiXinUrlFinals.BATCHTAGGINGURL;
        String result="";
        Map<String,Object> params=new HashMap<>();
        params.put("access_token",accessToken);
        Map<String,Object> formParams=new HashMap<>();
        formParams.put("openid_list",openIdList);
        formParams.put("tagid",tagId);

        result= HttpUtils.requestPostUrlBodyJSONParam(url,params,formParams);
        logger.info("batchtagging.result====={}",result);
        return result;
    }
    //取消打标签
    public static String unBatchtagging(String accessToken,List<String> openIdList,int tagId){
        String url= WeiXinUrlFinals.UNBATCHTAGGINGURL;
        String result="";
        Map<String,Object> params=new HashMap<>();
        params.put("access_token",accessToken);
        Map<String,Object> formParams=new HashMap<>();
        formParams.put("openid_list",openIdList);
        formParams.put("tagid",tagId);

        result= HttpUtils.requestPostUrlBodyJSONParam(url,params,formParams);
        logger.info("unBatchtagging.result====={}",result);
        return result;
    }
    //匹配标签
    public static String trymatch(String accessToken,String openId){
        String url= WeiXinUrlFinals.TRYMATCHURL;
        String result="";
        Map<String,Object> params=new HashMap<>();
        params.put("access_token",accessToken);
        Map<String,Object> formParams=new HashMap<>();
        formParams.put("user_id",openId);

        result= HttpUtils.requestPostUrlBodyJSONParam(url,params,formParams);
        logger.info("trymatch.result====={}",result);
        return result;
    }
    //获取用户身上的标签列表
    public static String getidlist(String accessToken,String openId){
        String url= WeiXinUrlFinals.GETIDLISTURL;
        String result="";
        Map<String,Object> params=new HashMap<>();
        params.put("access_token",accessToken);
        Map<String,Object> formParams=new HashMap<>();
        formParams.put("openid",openId);

        result= HttpUtils.requestPostUrlBodyJSONParam(url,params,formParams);
        logger.info("getidlist.result====={}",result);
        return result;
    }
    //获取用户信息
    public static String getUserInfo(String accessToken,String openId){
        String url= WeiXinUrlFinals.GETUSERINFO;
        String result="";
        Map<String,Object> params=new HashMap<>();
        params.put("access_token",accessToken);
        params.put("openid",openId);
        params.put("lang","zh_CN");


        result= HttpUtils.requestGet(url,params);
        logger.info("getUserInfo.result====={}",result);
        return result;
    }
    //通过网页获取用户信息
    public static String getOauthUserInfo(String appId,String secret,String code){
        String url= WeiXinUrlFinals.GETOAUTHUSERINFOURL;
        String result="";
        Map<String,Object> params=new HashMap<>();
        params.put("appid",appId);
        params.put("secret",secret);
        params.put("code",code);
        params.put("grant_type","authorization_code");
        result= HttpUtils.requestGet(url,params);
        logger.info("getOauthUserInfo.result====={}",result);
        return result;
    }
    public static void main(String[] args) {
        String appid="wx5365dca5cee6faea";
        String secret="79659eb27e7b0cf00ecc1da77d659096";
        String appidTest="wxce55f7ed02ae4e66";
        String secretTest="f3ebf525a742e8d04ecaa24451e0e999";
        String accessToken= WeiXinUtils.getAccessToken(appidTest,secretTest);
//        String accessToken= "40_MaFER9QbGXTfAXe6AplpMIdQvwvh0wTIZ3lG3IM3__2duSDIkJt2gQ0EAucymDoWMIcwo4cAfojJyr3Vg8Cg3AjTX__9rWJjSVVPVXnYxsVhHusncyeo90jHjmLXnSUV8Q6i6iBwzRI3u_D1YVChAJACZG";
        logger.info("accessToken==={}",accessToken);
//        String accessToken=WeiXinUtils.getAccessToken(appidTest,secretTest);
//        String result=WeiXinUtils.createMenu(accessToken);
//        logger.info("accessToken="+accessToken);
//        String result= WeiXinUtils.uploadImage(accessToken,"D:\\sql\\7.jpg");
//        logger.info("result={}",result);
        String filePath="D:\\sql\\1.jpg";
//        String result=WeiXinUtils.sendAll(accessToken,"qIRFgs7KXmb3DFsjveqRFnsY1v-6UE-UTPQ7QAGq86MYEAsTSYMCf-kyHJSwPyxS");
//        logger.info("result={}",result);
        //文件临时材料上传
//        String type="image";
//        String dirPath="D:/sql";
//        File dir=new File(dirPath);
//        File[] files=dir.listFiles();
//        for(File file:files){
////        File file=new File("D:/fiveHundredMiles.mp4");
//            String result=WeiXinUtils.upload(accessToken,file.getPath());
//            logger.info("result={}",result);
//        }
        //获取素材
//        String[] mediaIds=new String[]{
//                "fr0MqP22tqmjis41MGSqQ52uoX1fiq6VQKVyTVN-l3S8Dr8AOMMuk4DW1mEqGMO1",
//                "tPX_DfLsOb3pcj0yNQMerd_gWXd8Wu8i8Snsm_wpjeyEfe3c61miVG5FEX9HizUH",
//                "5NMmtmjDSlLNYnhAA3Q-w077Bnf-7kUTnfS3wiFbI2Gph6G0AOOGe0w7IQYeBBrW",
//                "2kF-YbS0gSNHSdJZXzhZsLqPwMGVjmHSFY9fETREX93qVYpj-i6XVQi12uMwR1Yj",
//                "qIRFgs7KXmb3DFsjveqRFnsY1v-6UE-UTPQ7QAGq86MYEAsTSYMCf-kyHJSwPyxS",
//        };
//        for(String mediaId:mediaIds)
//        {
//            String result=WeiXinUtils.getTempResource(accessToken,mediaIds[0]);
//            logger.info("result={}",result);
//        }
        //获取素材列表
//        String result=WeiXinUtils.getResourceList(accessToken);
//        logger.info("result={}",result);
//        String result=WeiXinUtils.getCallBackIp(accessToken);
//        logger.info("callbackIp.result={}",result);
//        result=WeiXinUtils.getAPIDomainIp(accessToken);
//        logger.info("getAPIDomainIp={}",result);
//        result=WeiXinUtils.checkNet(accessToken);

//        result=WeiXinUtils.createMenu(accessToken);
//        logger.info("createMenu.result={}",result);
//        result=WeiXinUtils.getMenu(accessToken);
//        logger.info("getMenu.result={}",result);



        //生成二维码
        QrCodeModel qrCodeModel=new QrCodeModel();
        qrCodeModel.setExpireSeconds(604800);
        qrCodeModel.setActionName("QR_SCENE");
        qrCodeModel.setSceneId(Integer.parseInt(WxEventUrlType.BURL.getKey()));
        qrCodeModel.setSceneStr("abcdefg");
        String result=WeiXinUtils.createTicket(accessToken,qrCodeModel);
        JSONObject qrCodeObject=JSONObject.parseObject(result);
        String ticket=qrCodeObject.getString("ticket");
        String qrCode=WeiXinUtils.showQrcode(ticket);
        System.out.println("qrCode="+qrCode);
//        System.out.println("createTicket.result=="+result);
//        JSONObject qrCodeObject=JSONObject.parseObject(result);
//        HttpResponse response=WeiXinUtils.showqrcode(qrCodeObject.getString("ticket"));
//
//        String contentType=response.header("Content-Type");
//        logger.info("contentType="+contentType);//image/jpg
//        InputStream inputStream=response.bodyStream();
//        String filename = "D:\\qrCode.jpg";  //下载路径及下载图片名称
//        File file = new File(filename);
//        try{
//            if(inputStream==null){
//                logger.info("无法生成文件");
//                return;
//            }
//            FileOutputStream os = new FileOutputStream(file, true);
//            FileCopyUtils.copy(inputStream,os);
//            System.out.println("showqrcode.result=="+result);
//        }catch(Exception e){
//            e.printStackTrace();
//        }
//

        //设置菜单
//        createTag(accessToken,"标签1");
//        String opendId="oquGis7BLdB5Yq_FcUm4NpQEafEY";
//        WeiXinUtils.getMenu2(accessToken);
//        WeiXinUtils.tagGet(accessToken);
//        List<String> openIdLists=new ArrayList<>();
//        openIdLists.add(opendId);//设置用户的openId
//        openIdLists.add("oquGisxYBe6IssYQ5T0JR5MDMU6o");
//        WeiXinUtils.unBatchtagging(accessToken,openIdLists,WeiXinUrlFinals.TAGA);
//        WeiXinUtils.batchtagging(accessToken,openIdLists,WeiXinUrlFinals.TAGB);
//        WeiXinUtils.trymatch(accessToken,opendId);
//        WeiXinUtils.getidlist(accessToken,opendId);

        //获取用户信息
//        WeiXinUtils.getUserInfo(accessToken,"oquGis2aA8fqtnejpbIU0k49IvFw");
    }

}
